﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;

namespace MxWeiXinPF.Web
{
    public class GetImage
    {
        private int F_Height;
        private int F_Width;
        private string MyURL;
        private int S_Height;
        private int S_Width;

        public GetImage(string WebSite, int ScreenWidth, int ScreenHeight, int ImageWidth, int ImageHeight)
        {
            this.WebSite = WebSite;
            this.ScreenHeight = ScreenHeight;
            this.ScreenWidth = ScreenWidth;
            this.ImageHeight = ImageHeight;
            this.ImageWidth = ImageWidth;
        }

        [STAThread]
        public Bitmap GetBitmap()
        {
            WebPageBitmap bitmap = new WebPageBitmap(this.WebSite, this.ScreenWidth, this.ScreenHeight);
            bitmap.GetIt();
            return bitmap.DrawBitmap(this.ImageHeight, this.ImageWidth);
        }

        public int ImageHeight
        {
            get
            {
                return this.F_Height;
            }
            set
            {
                this.F_Height = value;
            }
        }

        public int ImageWidth
        {
            get
            {
                return this.F_Width;
            }
            set
            {
                this.F_Width = value;
            }
        }

        public int ScreenHeight
        {
            get
            {
                return this.S_Height;
            }
            set
            {
                this.S_Height = value;
            }
        }

        public int ScreenWidth
        {
            get
            {
                return this.S_Width;
            }
            set
            {
                this.S_Width = value;
            }
        }

        public string WebSite
        {
            get
            {
                return this.MyURL;
            }
            set
            {
                this.MyURL = value;
            }
        }
    }
}